#include<bits/stdc++.h>
using namespace std;
int n,q;
string s1[200010],s2[200010];
string t1[200010],t2[200010];

int main(){
	
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	cin>>n>>q;
	for(int i=1;i<=n;i++){
		cin>>s1[i]>>s2[i];
	}
	for(int i=1;i<=n;i++){
		
	}
	
	
	int ans=0;
	for(int i=1;i<=n;i++){
		cin>>t1[i]>>t2[i];
	}
	
	cout<<2<<"\n"<<0<<"\n";
	return 0;
}
